package org.unicorn.android.base

import android.os.Bundle
import android.view.LayoutInflater
import androidx.appcompat.app.AppCompatActivity
import androidx.viewbinding.ViewBinding

/**
 *
 * @author     : liujianyou
 * @date : 2022/02/16 16:30
 * @Description:
 */
abstract class BaseActivity<VB : ViewBinding>(
    private val inflate: (LayoutInflater) -> VB,
) : AppCompatActivity() {

    protected val binding: VB by lazy { inflate(layoutInflater) }

    abstract fun initView(bind: VB)

    abstract fun initData()

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(binding.root)
        initView(binding)
        initData()
    }


}